package org.jeecg.modules.wms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 库存历史记录
 */
@Data
@TableName("wms_inventory_history")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "wms_inventory_history对象", description = "库存历史记录")
public class WmsInventoryHistory implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 库存ID
     */
    @Excel(name = "库存ID", width = 15)
    @ApiModelProperty(value = "库存ID")
    private String inventoryId;

    /**
     * 物料编码
     */
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String materialCode;

    /**
     * 物料名称
     */
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String materialName;

    /**
     * 物料类型（1-型材，2-配件，3-辅件，4-其他，5-余料，6-半料）
     */
    @Excel(name = "物料类型", width = 15, dicCode = "material_type")
    @ApiModelProperty(value = "物料类型")
    private Integer materialType;

    /**
     * 规格
     */
    @Excel(name = "规格", width = 15)
    @ApiModelProperty(value = "规格")
    private String specification;

    /**
     * 颜色
     */
    @Excel(name = "颜色", width = 15)
    @ApiModelProperty(value = "颜色")
    private String color;

    /**物料系列 */
    @Excel(name = "物料系列", width = 15)
    @ApiModelProperty(value = "物料系列")
    private String materialSeries;

    /**
     * 单位
     */
    @Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
    private String unit;

    /**
     * 仓库ID
     */
    @Excel(name = "仓库ID", width = 15)
    @ApiModelProperty(value = "仓库ID")
    private String warehouseId;

    /**
     * 仓库名称
     */
    @Excel(name = "仓库名称", width = 15)
    @ApiModelProperty(value = "仓库名称")
    @TableField(exist = false)
    private String warehouseName;

    /**
     * 库位ID
     */
    @Excel(name = "库位ID", width = 15)
    @ApiModelProperty(value = "库位ID")
    private String locationId;

    /**
     * 库位名称
     */
    @Excel(name = "库位名称", width = 15)
    @ApiModelProperty(value = "库位名称")
    @TableField(exist = false)
    private String locationName;

    /**
     * 业务类型（11-采购入库, 12-生产余料入库, 19-其他入库）
     */
    @Excel(name = "业务类型", width = 15, dicCode = "inventory_business_type")
    @ApiModelProperty(value = "业务类型")
    private Integer businessType;

    /**
     * 业务单号
     */
    @Excel(name = "业务单号", width = 15)
    @ApiModelProperty(value = "业务单号")
    private String businessNo;

    /**
     * 变动前数量
     */
    @Excel(name = "变动前数量", width = 15)
    @ApiModelProperty(value = "变动前数量")
    private BigDecimal beforeQuantity;

    /**
     * 变动数量
     */
    @Excel(name = "变动数量", width = 15)
    @ApiModelProperty(value = "变动数量")
    private BigDecimal changeQuantity;

    /**
     * 变动后数量
     */
    @Excel(name = "变动后数量", width = 15)
    @ApiModelProperty(value = "变动后数量")
    private BigDecimal afterQuantity;

    /**
     * 批次号
     */
    @Excel(name = "批次号", width = 15)
    @ApiModelProperty(value = "批次号")
    private String batchNo;

    /**
     * 物料图片
     */
    @Excel(name = "物料图片", width = 15)
    @ApiModelProperty(value = "物料图片")
    private String materialImages;

    /**
     * 供应商
     */
    @Excel(name = "供应商", width = 15)
    @ApiModelProperty(value = "供应商")
    private String supplier;

    /**
     * 操作人
     */
    @Excel(name = "操作人", width = 15)
    @ApiModelProperty(value = "操作人")
    private String operator;

    /**
     * 操作时间
     */
    @Excel(name = "操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "操作时间")
    private Date operateTime;

    /**
     * 备注
     */
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    private Integer tenantId;

    /**
     * 单位成本
     */
    @Excel(name = "单位成本", width = 15)
    @ApiModelProperty(value = "单位成本")
    private BigDecimal unitCost;

    /**
     * 变动前总成本
     */
    @Excel(name = "变动前总成本", width = 15)
    @ApiModelProperty(value = "变动前总成本")
    private BigDecimal beforeTotalCost;

    /**
     * 成本变动金额
     */
    @Excel(name = "成本变动金额", width = 15)
    @ApiModelProperty(value = "成本变动金额")
    private BigDecimal changeTotalCost;

    /**
     * 变动后总成本
     */
    @Excel(name = "变动后总成本", width = 15)
    @ApiModelProperty(value = "变动后总成本")
    private BigDecimal afterTotalCost;
    
    /**
     * 源物料ID（余料特有，不存入数据库）
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "源物料ID")
    private String sourceMaterialId;

    /**
     * 余料长度（余料特有，不存入数据库）
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "余料长度")
    private BigDecimal surplusLength;

    /**
     * 生产订单ID（余料特有，不存入数据库）
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "生产订单ID")
    private String productionOrderId;

    @TableField(exist = false)
    private String businessTypeName;
    
    // 手动添加getter和setter方法，确保编译时能够找到
    public String getSourceMaterialId() {
        return sourceMaterialId;
    }

    public void setSourceMaterialId(String sourceMaterialId) {
        this.sourceMaterialId = sourceMaterialId;
    }

    public BigDecimal getSurplusLength() {
        return surplusLength;
    }

    public void setSurplusLength(BigDecimal surplusLength) {
        this.surplusLength = surplusLength;
    }

    public String getProductionOrderId() {
        return productionOrderId;
    }

    public void setProductionOrderId(String productionOrderId) {
        this.productionOrderId = productionOrderId;
    }

    @TableField(exist = false)
    private String beginDate;

    @TableField(exist = false)
    private String endDate;
} 